home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Add-On
/
Workbench Add-On - Volume 1.iso
/
Music
/
MIDI
/
MidiPlay
/
ARexx
/
D10ToneChange.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-08-23
|
724b
|
45 lines
/* This script is made for Roland D10. Modify it to work on your setup.
This script changes tone number of timbre on channel 1.
Parameters: GroupNumber ToneNumber */
options results
parse arg Group0 Tone0 .
ManuID = 41
DevID = 0
ModelID = 16
CmdID = 12
Address = "0 0 0"
Group = x2c(Group0)
Tone = x2c(Tone0)
MyStr = Address c2x(Group) c2x(Tone)
Checksum = d2c(128-CalcChecksum(MyStr))
address 'MidiPlay_rexx'
'sysex' ManuID DevID ModelID CmdID MyStr c2x(Checksum)
exit
/* This function calculates the checksum of a hexadecimal string */
CalcChecksum:
parse arg DStr
val = 0
do while DStr ~= ""
parse var DStr M1 M2
r1 = c2d(x2c(M1))
val = c2d(bitand(d2c(val + r1),'7f'x))
DStr = M2
end
return val